<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改防雷重点单位')" />
	<link th:href="@{/css/boot.css}" rel="stylesheet" />
	<link th:href="@{/css/city-picker.css}" rel="stylesheet"  />
	<script th:src="@{/js/jquery.m.js}"></script>
	<script th:src="@{/js/boot.js}"></script>
	<script th:src="@{/js/city-picker.data.js}"></script>
	<script th:src="@{/js/city-picker.js}"></script>
	<script th:src="@{/js/main.js}"></script>
	<th:block th:include="include :: select2-css" />
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-js" />

</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tJcFlzddw-edit" th:object="${tJcFlzddw}">
            <input id="thunderUnitId" name="thunderUnitId" th:field="*{thunderUnitId}"  type="hidden" >
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
					<label class="col-sm-2 control-label"><span style="color: red;">*
					</span>社会统一信用代码：</label>
					<div class="col-sm-10">
					<input id="creditCode" name="creditCode" th:field="*{creditCode}" class="form-control" type="text" required>
					</div>
					</div>
				</div>
			</div>
			<div class="row">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-sm-2 control-label" ><span style="color: red; ">*
					</span>单位名称：</label>
					<div class="col-sm-10">
						<input  id="unitName" name="unitName" th:field="*{unitName}" class="form-control" type="text" required>
					</div>
				</div>
			</div>
			</div>
			<div class="row">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-sm-2 control-label"><span style="color: red">*
				</span>单位地址：</label>
					<div class="col-sm-10">
						<input id="unitAddress" name="unitAddress" th:field="*{unitAddress}" class="form-control" type="text">
					</div>
				</div>
			</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
					<label class="col-sm-4 control-label">所属行政区：</label>
					<div class="col-sm-8">
						<input name="administrativeRegion" id="city-picker3" class="form-control" readonly type="text" th:field="*{administrativeRegion}" data-toggle="city-picker">
					</div>
					</div>
				</div>
				<div class="col-sm-6">
						<div class="form-group">
						<label class="col-sm-4 control-label">邮政编码：</label>
						<div class="col-sm-8">
							<input id="emailCode" name="emailCode" th:field="*{emailCode}" class="form-control" type="text">
						</div>
					</div>
					</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
			<div class="form-group">
				<label class="col-sm-4 control-label">行业属性：</label>
				<div class="col-sm-8">
					<select name="tradeProperty" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw')}" style="margin-bottom: 0px;">
						<option value="">请选择行业属性</option>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{tradeProperty}"></option>
					</select>
				</div>
			</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
					<label class="col-sm-4 control-label">防雷类别：</label>
					<div class="col-sm-8">
						<select name="thunderCategory" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_type')}" >
							<option value="">请选择防雷类别</option>
							<option th:each="dict :${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{thunderCategory}"></option>
						</select>
					</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">检测周期：</label>
						<div class="col-sm-8">
							<select name="searchCycle" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_time')}">
								<option value="">请选择检测周期</option>
								<option th:each="dict :${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{searchCycle}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">联系人：</label>
						<div class="col-sm-8">
							<input id="contacts" name="contacts" th:field="*{contacts}" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">联系电话：</label>
						<div class="col-sm-8">
							<input id="contactsPhone" name="contactsPhone" th:field="*{contactsPhone}" class="form-control" type="text">
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">安全负责人：</label>
						<div class="col-sm-8">
							<input id="securityPeople" name="securityPeople" th:field="*{securityPeople}" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">安全负责人联系电话：</label>
						<div class="col-sm-8">
							<input id="securityPeoplePhone" name="securityPeoplePhone" th:field="*{securityPeoplePhone}" class="form-control" type="text">
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">成立时间：</label>
						<div class="col-sm-8">
							<input id="laydate-demo-1" name="foundDate" th:value="${#dates.format(tJcFlzddw.foundDate,'yyyy-MM-dd')}" class="form-control" type="text" placeholder="请选择成立日期">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">经营状态：</label>
						<div class="col-sm-8">
							<select name="manageStaus" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_manage')}" style="margin-bottom: 0px;">
								<option value="">请选择经营状态</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{manageStaus}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">是否违规：</label>
						<div class="col-sm-8">
							<select name="violation" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_record')}">
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">数据来源：</label>
						<div class="col-sm-8">
							<select name="dataSource" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_source')}">
								<option value="">请选择数据来源</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{dataSource}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label">备注：</label>
						<div class="col-sm-10">
					<textarea id="remark" name="remark" th:field="*{remark}"
							  class="form-control" type="text"></textarea>
						</div>
					</div>
				</div>
			</div>

		</form>
    </div>
	<div class="row">
		<div class="col-sm-offset-5 col-sm-10">
			<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
			<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		</div>
	</div>


    <script type="text/javascript">
		var prefix = ctx + "system/tJcFlzddw";
		$("#laydate-demo-1").datetimepicker({
			format: "yyyy-mm-dd",
			minView: "month",
			autoclose: true
		});
		$("#form-tJcFlzddw-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		/*function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-tJcFlzddw-edit').serialize());
	        }
	    }*/
		function submitHandler() {
			if ($.validate.form()) {
				var data = $("#form-tJcFlzddw-edit").serializeArray();
				var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
				var roleIds = $.form.selectCheckeds("role");
				var postIds = $.form.selectSelects("post");
				data.push({"name": "status", "value": status});
				data.push({"name": "roleIds", "value": roleIds});
				data.push({"name": "postIds", "value": postIds});
				$.operate.saveTab(prefix + "/edit", data);
			}
		}
		/*/!*用户管理-修改-选择部门树*!/
		function selectDeptTree() {
			var createId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
			var url = ctx + "system/tJcFlzddwCount/selectDeptTree/" + createId;
			var options = {
				title: '选择部门',
				width: "380",
				url: url,
				callBack: doSubmit
			};
			$.modal.openOptions(options);
		}
		function doSubmit(index, layero){
			var tree = layero.find("iframe")[0].contentWindow.$._tree;
			if ($.tree.notAllowParents(tree)) {
				var body = layer.getChildFrame('body', index);
				$("#treeId").val(body.find('#treeId').val());
				$("#treeName").val(body.find('#treeName').val());
				layer.close(index);
			}
		}*/

	</script>
</body>
</html>
